//
//  DatabaseHandle.h
//  UI_豆瓣
//
//  Created by WangZe on 15/10/14.
//  Copyright © 2015年 王泽龙. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "ActivityList.h"

typedef NS_ENUM(NSUInteger, SelectType) {
    InTable,
    NotInTable,
    SelectError,
};

@interface DatabaseHandle : NSObject
{
    sqlite3 *dbPoint;
    
}

// 创建数据库
// 为了确保数据库的唯一性,用单列方式写数据库
+ (instancetype)shareDatabaseHandle;
// 打开数据库
- (void)openDB;
// 创建数据表
- (void)createTable;
// 插入一条数据
- (void)insertActivity:(ActivityList *)activity;
// 删除一条数据
- (void)deleteActivity:(ActivityList *)activity;
// 更新一条数据
- (void)updateActivity:(ActivityList *)activity;
// 查找数据
- (NSMutableArray *)selectAllActivity;
// 关闭数据库
- (void)closeDB;
// 判断是否有数据
- (SelectType)isHaveActivity:(ActivityList *)activity;





@end
